package demo28;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String first = scanner.nextLine();
        String second = scanner.nextLine();

        Set<Character> toRemove = new HashSet<>();
        for (char c: second.toCharArray()) {
            toRemove.add(c);
        }

        StringBuilder result = new StringBuilder();
        for (char c : first.toCharArray()){
            if (!toRemove.contains(c)){
                result.append(c);
            }
        }
        System.out.println(result.toString());
    }
}
